import { LayoutMode, ComponentSize, SidebarColor, ThemeMode, LanguageEnum } from "./enums";

const { pkg } = __APP_INFO__;

// 检查用户的操作系统是否使用深色模式
const mediaQueryList = window.matchMedia("(prefers-color-scheme: dark)");

const defaultSettings: AppSettings = {
  // 系统Title
  title: pkg.name,
  // 系统版本
  version: pkg.version,
  // 是否显示设置
  showSettings: true,
  // 是否显示标签视图
  tagsView: true,
  // 是否显示侧边栏Logo
  sidebarLogo: true,
  // 布局方式，默认为左侧布局
  layout: LayoutMode.LEFT,
  // 主题，根据操作系统的色彩方案自动选择
  theme: mediaQueryList.matches ? ThemeMode.DARK : ThemeMode.LIGHT,
  // 组件大小 default | medium | small | large
  size: ComponentSize.DEFAULT,
  // 语言
  language: LanguageEnum.ZH_CN,
  // 主题颜色
  themeColor: "#4080FF",
  // 是否开启水印
  watermarkEnabled: false,
  // 水印内容
  watermarkContent: pkg.name,
  // 侧边栏配色方案
  sidebarColorScheme: SidebarColor.CLASSIC_BLUE,
};

export default defaultSettings;

export const routers = [
  {
    path: "/system",
    component: "Layout",
    redirect: "/system/user",
    name: "/system",
    meta: {
      title: "用户管理",
      icon: "system",
      hidden: false,
      alwaysShow: false,
      params: null,
    },
    children: [
      {
        path: "user",
        component: "system/user/index",
        name: "User",
        meta: {
          title: "用户信息管理",
          icon: "el-icon-User",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
      {
        path: "role",
        component: "system/role/index",
        name: "Role",
        meta: {
          title: "用户行为分析",
          icon: "role",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
      {
        path: "notice",
        component: "system/notice/index",
        name: "Notice",
        meta: {
          title: "用户反馈管理",
          icon: "",
          hidden: false,
          alwaysShow: false,
          params: null,
        },
      },
    ],
  },
  {
    path: "/codegen",
    component: "Layout",
    name: "/codegen",
    meta: {
      title: "简历管理",
      icon: "menu",
      hidden: false,
      alwaysShow: false,
      params: null,
    },
    children: [
      {
        path: "codegen",
        component: "codegen/index",
        name: "Codegen",
        meta: {
          title: "简历存储管理",
          icon: "code",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
    ],
  },
  {
    path: "/api",
    component: "Layout",
    redirect: "/api/apifox",
    name: "/api",
    meta: {
      title: "模拟面试管理",
      icon: "api",
      hidden: false,
      alwaysShow: true,
      params: null,
    },
    children: [
      {
        path: "dict",
        component: "system/dict/index",
        name: "Dict",
        meta: {
          title: "笔试题目库管理",
          icon: "api",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
      {
        path: "log",
        component: "system/log/index",
        name: "Log",
        meta: {
          title: "笔试题目日志",
          icon: "document",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
      {
        path: "config",
        component: "system/config/index",
        name: "Config",
        meta: {
          title: "面试场景设置管理",
          icon: "document",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
      {
        path: "apifox",
        component: "demo/api/apifox",
        name: "Apifox",
        meta: {
          title: "面试评估与建议管理",
          icon: "document",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
    ],
  },
  {
    path: "/doc",
    component: "Layout",
    redirect: "https://juejin.cn/post/7228990409909108793",
    name: "/doc",
    meta: {
      title: "职业规划管理",
      icon: "document",
      hidden: false,
      alwaysShow: false,
      params: null,
    },
    children: [
      {
        path: "internal-doc",
        component: "demo/internal-doc",
        name: "InternalDoc",
        meta: {
          title: "职业规划管理模块",
          icon: "document",
          hidden: false,
          alwaysShow: false,
          params: null,
        },
      },
      {
        path: "https://juejin.cn/post/7228990409909108793",
        name: "Https://juejin.cn/post/7228990409909108793",
        meta: {
          title: "职业规划生成与更新",
          icon: "document",
          hidden: false,
          alwaysShow: false,
          params: null,
        },
      },
    ],
  },
  {
    path: "/multi-level",
    component: "Layout",
    redirect: "/multi-level/multi-level1/multi-level2/multi-level3-1",
    name: "/multiLevel",
    meta: {
      title: "能力分析管理",
      icon: "cascader",
      hidden: false,
      alwaysShow: true,
      params: null,
    },
    children: [
      {
        path: "multi-level1",
        component: "demo/multi-level/level1",
        redirect: "/multi-level/multi-level1/multi-level2/multi-level3-1",
        name: "MultiLevel1",
        meta: {
          title: "能力评估指标管理",
          icon: "",
          hidden: false,
          alwaysShow: true,
          params: null,
        },

        children: [
          {
            path: "multi-level2",
            component: "demo/multi-level/children/level2",
            redirect: "/multi-level/multi-level1/multi-level2/multi-level3-1",
            name: "MultiLevel2",
            meta: {
              title: "菜单二级",
              icon: "",
              hidden: false,
              alwaysShow: false,
              params: null,
            },
            children: [
              {
                path: "multi-level3-1",
                component: "demo/multi-level/children/children/level3-1",
                name: "MultiLevel31",
                meta: {
                  title: "菜单三级-1",
                  icon: "",
                  hidden: false,
                  keepAlive: true,
                  alwaysShow: false,
                  params: null,
                },
              },
              {
                path: "multi-level3-2",
                component: "demo/multi-level/children/children/level3-2",
                name: "MultiLevel32",
                meta: {
                  title: "菜单三级-2",
                  icon: "",
                  hidden: false,
                  keepAlive: true,
                  alwaysShow: false,
                  params: null,
                },
              },
            ],
          },
        ],
      },
      {
        path: "internal-doc",
        component: "demo/internal-doc",
        name: "InternalDoc",
        meta: {
          title: "可视化图表管理",
          icon: "document",
          hidden: false,
          alwaysShow: false,
          params: null,
        },
      },
      {
        path: "curd",
        component: "demo/curd/index",
        name: "InternalDoc",
        meta: {
          title: "学习路径与资料管理",
          icon: "document",
          hidden: false,
          alwaysShow: false,
          params: null,
        },
      },
    ],
  },
  {
    path: "/component",
    component: "Layout",
    name: "/component",
    meta: {
      title: "职位推荐管理",
      icon: "menu",
      hidden: false,
      alwaysShow: false,
      params: null,
    },
    children: [
      {
        path: "curd",
        component: "demo/curd/index",
        name: "Curd",
        meta: {
          title: "职位信息管理",
          icon: "",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
      {
        path: "table-select",
        component: "demo/table-select/index",
        name: "TableSelect",
        meta: {
          title: "职位推荐算法管理",
          icon: "",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
      {
        path: "wang-editor",
        component: "demo/wang-editor",
        name: "WangEditor",
        meta: {
          title: "职位收藏与推送管理",
          icon: "",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
    ],
  },
  {
    path: "/route-param",
    component: "Layout",
    name: "/routeParam",
    meta: {
      title: "系统管理",
      icon: "el-icon-ElementPlus",
      hidden: false,
      alwaysShow: true,
      params: null,
    },
    children: [
      {
        path: "route-param-type1",
        component: "demo/route-param",
        name: "RouteParamType1",
        meta: {
          title: "数据备份与恢复",
          icon: "el-icon-Star",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: {
            type: "1",
          },
        },
      },
      {
        path: "route-param-type2",
        component: "demo/route-param",
        name: "RouteParamType2",
        meta: {
          title: "系统性能监控",
          icon: "el-icon-StarFilled",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: {
            type: "2",
          },
        },
      },
      {
        path: "route-param-type2",
        component: "demo/route-param",
        name: "RouteParamType2",
        meta: {
          title: "安全与权限管理",
          icon: "el-icon-StarFilled",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: {
            type: "2",
          },
        },
      },
    ],
  },
  {
    path: "/function",
    component: "Layout",
    name: "/function",
    meta: {
      title: "内容管理",
      icon: "menu",
      hidden: false,
      alwaysShow: false,
      params: null,
    },
    children: [
      {
        path: "icon-demo",
        component: "demo/icons",
        name: "IconDemo",
        meta: {
          title: "文章与资讯管理",
          icon: "el-icon-Notification",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
      {
        path: "/function/websocket",
        component: "demo/websocket",
        name: "/function/websocket",
        meta: {
          title: "学习资料管理",
          icon: "",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
      {
        path: "/function/dict-sync",
        component: "demo/dict-sync",
        name: "/function/dictSync",
        meta: {
          title: "字典实时同步",
          icon: "",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
    ],
  },
  {
    path: "/function",
    component: "Layout",
    name: "/function",
    meta: {
      title: "数据分析与报告",
      icon: "menu",
      hidden: false,
      alwaysShow: false,
      params: null,
    },
    children: [
      {
        path: "icon-demo",
        component: "demo/icons",
        name: "IconDemo",
        meta: {
          title: "用户数据分析",
          icon: "el-icon-Notification",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
      {
        path: "/function/websocket",
        component: "demo/websocket",
        name: "/function/websocket",
        meta: {
          title: "系统运行数据分析",
          icon: "",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
      {
        path: "/function/dict-sync",
        component: "demo/dict-sync",
        name: "/function/dictSync",
        meta: {
          title: "业务数据分析",
          icon: "",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
    ],
  },
  {
    path: "/function",
    component: "Layout",
    name: "/function",
    meta: {
      title: "客服与支持",
      icon: "menu",
      hidden: false,
      alwaysShow: false,
      params: null,
    },
    children: [
      {
        path: "icon-demo",
        component: "demo/icons",
        name: "IconDemo",
        meta: {
          title: "在线客服管理",
          icon: "el-icon-Notification",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
      {
        path: "/function/websocket",
        component: "demo/websocket",
        name: "/function/websocket",
        meta: {
          title: "技术支持管理",
          icon: "",
          hidden: false,
          keepAlive: true,
          alwaysShow: false,
          params: null,
        },
      },
    ],
  },
];
